import apiClient from './index';


export const getUsers = () => {
  return apiClient.get('/user');
};

export const login = (username: String, password: String) => {
  return apiClient.post('/user/login', null, {
    params: {
      username: username,
      password: password
    }
  });
}


export const getUser = (id: number) => {
  return apiClient.get(`/user/${id}`);
};

export const createUser = (data: object) => {
  return apiClient.post('/user', data);
};

export const updateUser = (id: number, data: object) => {
  return apiClient.put(`/user/${id}`, data);
};

export const deleteUser = (id: number) => {
  return apiClient.delete(`/user/${id}`);
};

